﻿CREATE  proc [dbo].[danhmucNXTPham_Sua]
@ma_ptnx varchar(255),

@ten_ptnx nvarchar(255),
@ma_ptnx_old varchar(255)

as
if exists(select * from DM_NX_TPham  Where ma_ptnx <>@ma_ptnx  and ten_ptnx =@ten_ptnx   )
begin
select ErrCode=0
end
else
begin
update DM_NX_TPham   set ten_ptnx =@ten_ptnx 
 WHere ma_ptnx =@ma_ptnx_old 
 
select ErrCode=1
end